import { Controller, Get, Post, Body, Param, Query } from '@nestjs/common';
import { ParamService } from './param.service';
import { GetParamPageDto, AddParamDto } from './param.dto';

@Controller('admin/param')
export class ParamController {
  constructor(private readonly paramService: ParamService) { }

  @Get('page')
  getParamPage(@Query() getParamPageDto: GetParamPageDto) {
    return this.paramService.getParamPage(getParamPageDto);
  }

  @Post('add')
  addParam(@Body() addParamDto: AddParamDto) {
    return this.paramService.addParam(addParamDto);
  }

  @Get('pv/:code')
  getPvByCode(@Param('code') code: string) {
    return this.paramService.getPvByCode(code);
  }


  @Get('publicValue/:code')
  getPublicValueByCode(@Param('code') code: string) {
    return this.paramService.getPublicValueByCode(code);
  }
}
